// 文章分类路由模块
const express = require('express')
const router = express.Router()
const {
  add_cate_schema, delete_cate_schema, get_cate_schema, updated_cate_schema
} = require('../schema/artcate')
const expressJOI=require('@escook/express-joi')
const {
  getArtCates, addArtCates, deleteCateById, addCateById, updateCateById
} = require('../router_handler/artcate')
// 获取文章分类列表
router.get('/cates', getArtCates)
// 新增文章分类路由
router.post('/addcates', expressJOI(add_cate_schema), addArtCates)
// 根据id删除文章分类
router.get('/delete/:id', expressJOI(delete_cate_schema), deleteCateById)
// 根据id获取文章分类
router.get('/cate/:id', expressJOI(get_cate_schema), addCateById)
module.exports = router
// 根据id更新文章分类
router.post('/updatecate', expressJOI(updated_cate_schema), updateCateById)